package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"github.com/gin-gonic/gin/binding"
)

type user struct {
	name string
	age  int
}

func main() {
	router := gin.Default()

	router.POST("/addPeople", func(context *gin.Context) {
		var user user
		err := context.ShouldBindBodyWith(&user, binding.JSON)
		if err != nil {
			fmt.Println(err)
		} else {
			fmt.Println(user)
		}
	})
	router.Run()
}
